home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11860 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 65 | 6e 61 74 6f 72 2d 62 65 |Path: se|nator-be|
|00000010| 64 66 65 6c 6c 6f 77 2e | 6d 69 74 2e 65 64 75 21 |dfellow.|mit.edu!|
|00000020| 75 73 65 6e 65 74 0a 46 | 72 6f 6d 3a 20 49 6d 72 |usenet.F|rom: Imr|
|00000030| 61 6e 20 48 61 71 20 3c | 69 68 61 71 40 6d 69 74 |an Haq <|ihaq@mit|
|00000040| 2e 65 64 75 3e 0a 4e 65 | 77 73 67 72 6f 75 70 73 |.edu>.Ne|wsgroups|
|00000050| 3a 20 63 6f 6d 70 2e 6c | 61 6e 67 2e 63 2b 2b 0a |: comp.l|ang.c++.|
|00000060| 53 75 62 6a 65 63 74 3a | 20 48 45 4c 50 3a 20 41 |Subject:| HELP: A|
|00000070| 6c 67 6f 72 69 74 68 6d | 20 66 6f 72 20 6f 72 64 |lgorithm| for ord|
|00000080| 65 72 69 6e 67 20 28 78 | 2c 79 29 20 63 6f 6f 72 |ering (x|,y) coor|
|00000090| 64 69 6e 61 74 65 73 0a | 44 61 74 65 3a 20 53 61 |dinates.|Date: Sa|
|000000a0| 74 2c 20 31 36 20 4d 61 | 72 20 31 39 39 36 20 31 |t, 16 Ma|r 1996 1|
|000000b0| 34 3a 30 33 3a 31 38 20 | 2d 30 34 30 30 0a 4f 72 |4:03:18 |-0400.Or|
|000000c0| 67 61 6e 69 7a 61 74 69 | 6f 6e 3a 20 4d 61 73 73 |ganizati|on: Mass|
|000000d0| 61 63 68 76 73 65 74 74 | 73 20 49 6e 73 74 69 74 |achvsett|s Instit|
|000000e0| 76 74 65 20 6f 66 20 54 | 65 63 68 6e 6f 6c 6f 67 |vte of T|echnolog|
|000000f0| 79 0a 4d 65 73 73 61 67 | 65 2d 49 44 3a 20 3c 33 |y.Messag|e-ID: <3|
|00000100| 31 34 42 30 32 36 36 2e | 34 35 36 41 40 6d 69 74 |14B0266.|456A@mit|
|00000110| 2e 65 64 75 3e 0a 52 65 | 70 6c 79 2d 54 6f 3a 20 |.edu>.Re|ply-To: |
|00000120| 69 68 61 71 40 6d 69 74 | 2e 65 64 75 0a 4e 4e 54 |ihaq@mit|.edu.NNT|
|00000130| 50 2d 50 6f 73 74 69 6e | 67 2d 48 6f 73 74 3a 20 |P-Postin|g-Host: |
|00000140| 72 61 6c 65 69 67 68 2e | 6d 69 74 2e 65 64 75 0a |raleigh.|mit.edu.|
|00000150| 4d 69 6d 65 2d 56 65 72 | 73 69 6f 6e 3a 20 31 2e |Mime-Ver|sion: 1.|
|00000160| 30 0a 43 6f 6e 74 65 6e | 74 2d 54 79 70 65 3a 20 |0.Conten|t-Type: |
|00000170| 74 65 78 74 2f 70 6c 61 | 69 6e 3b 20 63 68 61 72 |text/pla|in; char|
|00000180| 73 65 74 3d 75 73 2d 61 | 73 63 69 69 0a 43 6f 6e |set=us-a|scii.Con|
|00000190| 74 65 6e 74 2d 54 72 61 | 6e 73 66 65 72 2d 45 6e |tent-Tra|nsfer-En|
|000001a0| 63 6f 64 69 6e 67 3a 20 | 37 62 69 74 0a 58 2d 4d |coding: |7bit.X-M|
|000001b0| 61 69 6c 65 72 3a 20 4d | 6f 7a 69 6c 6c 61 20 32 |ailer: M|ozilla 2|
|000001c0| 2e 30 20 28 4d 61 63 69 | 6e 74 6f 73 68 3b 20 49 |.0 (Maci|ntosh; I|
|000001d0| 3b 20 50 50 43 29 0a 0a | 48 65 72 65 20 69 73 20 |; PPC)..|Here is |
|000001e0| 61 20 70 72 6f 62 6c 65 | 6d 20 74 68 61 74 20 49 |a proble|m that I|
|000001f0| 20 63 61 6e 27 74 20 73 | 65 65 6d 20 74 6f 20 65 | can't s|eem to e|
|00000200| 78 70 72 65 73 73 20 69 | 6e 20 63 6f 64 65 20 65 |xpress i|n code e|
|00000210| 61 73 69 6c 79 20 75 73 | 69 6e 67 20 53 54 4c 3a |asily us|ing STL:|
|00000220| 0a 0a 49 27 6d 20 74 72 | 79 69 6e 67 20 74 6f 20 |..I'm tr|ying to |
|00000230| 6f 72 64 65 72 20 61 20 | 73 65 74 20 6f 66 20 28 |order a |set of (|
|00000240| 78 2c 79 29 20 63 6f 6f | 72 64 69 6e 61 74 65 73 |x,y) coo|rdinates|
|00000250| 20 69 6e 20 61 6e 20 61 | 6e 69 74 63 6c 6f 63 6b | in an a|nitclock|
|00000260| 77 69 73 65 20 73 65 6e | 73 65 2e 20 54 6f 0a 63 |wise sen|se. To.c|
|00000270| 6f 6d 70 75 74 65 20 77 | 68 65 74 68 65 72 20 74 |ompute w|hether t|
|00000280| 68 65 20 63 6f 6f 72 64 | 69 6e 61 74 65 73 20 61 |he coord|inates a|
|00000290| 72 65 20 69 6e 64 65 65 | 64 20 61 6e 74 69 63 6c |re indee|d anticl|
|000002a0| 6f 63 6b 77 69 73 65 2c | 20 49 27 6d 20 63 6f 6d |ockwise,| I'm com|
|000002b0| 70 75 74 69 6e 67 20 74 | 68 65 0a 6e 6f 72 6d 61 |puting t|he.norma|
|000002c0| 6c 20 76 65 63 74 6f 72 | 20 70 65 72 70 65 6e 64 |l vector| perpend|
|000002d0| 69 63 75 6c 61 72 20 74 | 6f 20 61 20 70 6c 61 6e |icular t|o a plan|
|000002e0| 65 20 64 65 66 69 6e 65 | 64 20 62 79 20 28 6f 76 |e define|d by (ov|
|000002f0| 65 72 6c 61 70 70 69 6e | 67 29 20 73 75 62 73 65 |erlappin|g) subse|
|00000300| 74 73 20 63 6f 6e 74 61 | 69 6e 69 6e 67 0a 33 20 |ts conta|ining.3 |
|00000310| 6e 6f 64 65 73 20 65 61 | 63 68 2e 20 49 66 20 74 |nodes ea|ch. If t|
|00000320| 68 65 20 6e 6f 72 6d 61 | 6c 20 76 65 63 74 6f 72 |he norma|l vector|
|00000330| 20 69 73 20 70 6f 73 69 | 74 69 76 65 2c 20 74 68 | is posi|tive, th|
|00000340| 65 20 6f 72 64 65 72 20 | 69 73 20 63 6f 72 72 65 |e order |is corre|
|00000350| 63 74 2c 20 6f 74 68 65 | 72 77 69 73 65 0a 49 20 |ct, othe|rwise.I |
|00000360| 6a 75 73 74 20 73 77 61 | 70 20 63 6f 6f 72 64 69 |just swa|p coordi|
|00000370| 6e 61 74 65 20 70 6f 73 | 69 74 69 6f 6e 73 2e 20 |nate pos|itions. |
|00000380| 0a 0a 54 68 65 20 70 72 | 6f 62 6c 65 6d 20 69 73 |..The pr|oblem is|
|00000390| 20 74 68 61 74 20 49 27 | 6d 20 74 72 79 69 6e 67 | that I'|m trying|
|000003a0| 20 74 6f 20 75 73 65 20 | 53 54 4c 27 73 20 67 65 | to use |STL's ge|
|000003b0| 6e 65 72 69 63 20 73 6f | 72 74 20 61 6c 67 6f 72 |neric so|rt algor|
|000003c0| 69 74 68 6d 20 74 6f 20 | 64 6f 20 74 68 69 73 0a |ithm to |do this.|
|000003d0| 61 6e 64 20 73 75 70 70 | 6c 79 69 6e 67 20 61 20 |and supp|lying a |
|000003e0| 63 75 73 74 6f 6d 20 63 | 6f 6d 70 61 72 69 73 6f |custom c|ompariso|
|000003f0| 6e 20 66 75 6e 63 74 69 | 6f 6e 2e 20 48 6f 77 65 |n functi|on. Howe|
|00000400| 76 65 72 2c 20 74 68 65 | 20 66 6f 72 6d 20 6f 66 |ver, the| form of|
|00000410| 20 74 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 0a 72 | this fu|nction.r|
|00000420| 65 71 75 69 72 65 73 20 | 6f 6e 6c 79 20 74 77 6f |equires |only two|
|00000430| 20 61 72 67 75 6d 65 6e | 74 73 2c 20 6e 6f 74 20 | argumen|ts, not |
|00000440| 74 68 65 20 33 20 49 20 | 6e 65 65 64 20 74 6f 20 |the 3 I |need to |
|00000450| 63 6f 6d 70 75 74 65 20 | 6f 72 64 65 72 2e 20 49 |compute |order. I|
|00000460| 6e 20 66 61 63 74 2c 20 | 77 68 61 74 0a 49 20 72 |n fact, |what.I r|
|00000470| 65 61 6c 6c 79 20 6e 65 | 65 64 20 69 73 20 74 6f |eally ne|ed is to|
|00000480| 20 68 61 76 65 20 74 68 | 69 73 20 63 75 73 74 6f | have th|is custo|
|00000490| 6d 20 66 75 6e 63 74 69 | 6f 6e 20 61 75 74 6f 6d |m functi|on autom|
|000004a0| 61 74 69 63 61 6c 6c 79 | 20 61 63 63 65 70 74 20 |atically| accept |
|000004b0| 74 68 65 20 0a 66 69 72 | 73 74 20 63 6f 6f 72 64 |the .fir|st coord|
|000004c0| 69 6e 61 74 65 20 70 61 | 69 72 20 61 73 20 61 20 |inate pa|ir as a |
|000004d0| 72 65 66 65 72 65 6e 63 | 65 20 70 6f 69 6e 74 2c |referenc|e point,|
|000004e0| 20 61 6e 64 20 6d 6f 64 | 69 66 79 20 74 68 65 20 | and mod|ify the |
|000004f0| 6f 72 64 65 72 20 6f 66 | 20 74 68 65 20 32 6e 64 |order of| the 2nd|
|00000500| 20 61 6e 64 20 33 72 64 | 0a 70 6f 69 6e 74 73 20 | and 3rd|.points |
|00000510| 69 66 20 74 68 65 79 20 | 61 72 65 20 6e 6f 74 20 |if they |are not |
|00000520| 61 6e 74 69 63 6c 6f 63 | 6b 77 69 73 65 2e 20 0a |anticloc|kwise. .|
|00000530| 0a 41 6e 79 20 73 75 67 | 67 65 73 74 69 6f 6e 73 |.Any sug|gestions|
|00000540| 3f 20 4f 72 20 64 6f 20 | 49 20 6e 65 65 64 20 74 |? Or do |I need t|
|00000550| 6f 20 77 72 69 74 65 20 | 61 20 73 6f 72 74 20 61 |o write |a sort a|
|00000560| 6c 67 6f 72 69 74 68 6d | 20 6f 75 74 73 69 64 65 |lgorithm| outside|
|00000570| 20 77 68 61 74 20 53 54 | 4c 20 70 72 6f 76 69 64 | what ST|L provid|
|00000580| 65 73 3f 0a 0a 0a 49 6d | 72 61 6e 20 48 61 71 0a |es?...Im|ran Haq.|
|00000590| 69 68 61 71 40 6d 69 74 | 2e 65 64 75 0a |ihaq@mit|.edu. |
+--------+-------------------------+-------------------------+--------+--------+